package it.trekker.prefetch;

import java.util.List;
import it.trekker.dao.Excursion;
import it.trekker.dao.GPSCoordinate;

public interface IExcursionsCache {
	
	/**
	 * Retrives an excursion from the cache.
	 */
	public Excursion getExcursionById(int id);
	
	/**
	 * Adds an excursion to the cache.
	 */
	public int addExcursion(Excursion excursion);
	
	/**
	 * Retrives all excursions in the cache.
	 */
	public List<Excursion> getAllCachedExcursions();
	
	/**
	 * Retrieves excursions in cache included within an area with the given radius,
	 * centered in the point where the given excursion starts.
	 */
	public List<Excursion> getExcursionsFromCache(Excursion excursion, double radius);
	
	/**
	 * Retrieves excursions in cache included within an area with the given radius,
	 * centered in the given point.
	 */
	public List<Excursion> getExcursionsFromCache(GPSCoordinate point, double radius);
	
	/**
	 * Invalidates the cache.
	 */
	public void invalidateCache();
	
	/**
	 * Log all excursions into the cache.
	 */
	public void logAllCache();
}
